package com.glorysoft.xztpda.bindingadapter;

import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentManager;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.glorysoft.xztpda.R;
import com.pda.platform.ui.ui_pdaplatform.callback.FreeUI_CommonCallback;
import com.pda.platform.ui.ui_pdaplatform.utils_public.FreeApi_DialogUtils;

import java.util.List;

/**
 * FileName: AddCarrierDataAdapter
 * Author: XJH
 * Date: 2020/5/22 19:52
 * Description:
 * History:
 */
public class AddCarrierDataAdapter extends BaseQuickAdapter<String, BaseViewHolder> {

    public AddCarrierDataAdapter(@Nullable List<String> data) {
        super(R.layout.item_add_carrier_data,data);
    }

    @Override
    protected void convert(BaseViewHolder helper, String item) {
        helper.setText(R.id.tvPosition,String.valueOf(helper.getAdapterPosition() + 1));
        helper.setText(R.id.tvCarrierID,String.valueOf(item));
        helper.getView(R.id.ivDelete).setOnClickListener(view -> {
            remove(helper.getAdapterPosition());
            notifyDataSetChanged();
        });
    }
}
